home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / lcppb.zip / LCPPANS.ZIP / ONEKEY.CPP < prev    next >
C/C++ Source or Header  |  1991-07-08  |  551b  |  31 lines

  1. // onekey.cpp -- Function to get a specific key
  2.  
  3. #include <iostream.h>
  4. #include "key.h"
  5. #include "key.doc"
  6.  
  7. int oneKey(int keyToGet);
  8.  
  9. main()
  10. {
  11.   cout << "Press <F1>...";
  12.   while (!oneKey(KEY_F1)) ;
  13.   cout << "\nOkay, thanks!";
  14. }
  15.  
  16. int oneKey(int keyToGet)
  17. {
  18.   int c;
  19.  
  20.   while ((c = getKey()) != keyToGet) ;
  21.   return c;
  22. }
  23.  
  24.  
  25. // Copyright (c) 1990 by Tom Swan. All rights reserved
  26. // Revision 1.00    Date: 10/26/1990   Time: 07:53 pm
  27.  
  28. // Revision 1.01    Date: 07/08/1991   Time: 05:41 pm
  29. // Converted for Borland C++ 2.0
  30.  
  31.